Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



How to use the video recorder utility


Overview

The Video recorder utility is used to record video clips to files, descriptors or URLs and manipulate embedded meta data. This functionality is implemented by the CVideoRecorderUtility class.

[Top]


Description

The sequence diagram below explains the different functionalities of the Video Recorder Utility:

Video Recorder sequence diagram

Video Recorder sequence diagram

Using a video recorder utility involves the following tasks:


Construct utility object and open recording device

The MMF (MultiMedia Framework) provides a simple interface to the application level API called CVideoRecorderUtility. Using this interface, you can record a video clip and set meta data and control information for it. The resultant video clip can be saved to a file, descriptor, or URL. You can create an object of this utility class using the CVideoRecorderUtility::NewL function. Some video formats also allow storing of audio data. To facilitate this feature, the class contains audio functions that can manipulate audio data.

void CRecordVideo::ConstructL()
    {
    iVideoRecordUtility = CVideoRecorderUtility::NewL(*this);
    }

Certain parameters like, the handle to the camera, the controller UID, video format and the codecs to use for video and audio need to be specified for recording. This is shown in the range of open statements shown below based on where you want to save the video clip:

Once the camera is ready and the video clip is opened successfully, call the CVideoRecorderUtility::Prepare() function. This function prepares the record controller for use. When the preparation of the record controller is complete, successfully or otherwise, a callback function MVideoRecorderUtilityObserver::MvruoPrepareComplete is called to notify that the video recorder is ready to record.


Configure video recording parameters

General

This category details various functions used to set and report playback priorities in relation to other applications that are trying to use audio/video resources. Use the following functions to detect or set audio tracks within video clips and also report and set video frame sizes:

MIME type and Codecs

This sections covers the reporting and setting of formats and codecs for video and audio data. You can use the following functions to report and set video and audio codecs.

Bit and frame rates

You can use the following functions to report the bit and frame rate settings for video clips and associated audio tracks.

Gain

The functions for controlling gain settings for recording devices are CVideoRecorderUtility::GainL(), CVideoRecorderUtility::SetGainL() and CVideoRecorderUtility::MaxGainL(). GainL() returns the current recording gain. SetGainL() sets the audio recording gain. MaxGain() returns the maximum possible setting for the recording gain.

 TInt CRecordVideo::GainL() 
    {
    return iVideoRecordUtility->GainL();
    }

void CRecordVideo::SetGainL(TInt aGain)
    {
    iVideoRecordUtility->SetGainL(aGain);
    }

TInt CRecordVideo::MaxGainL() 
    {
    return iVideoRecordUtility->MaxGainL();
    }


Record and related functions

If you are using an audio clip, the recording gain must be set using the CVideoRecorderUtility::SetGainL() function before recording because the initial gain is undefined or may also have been modified by another client application. The specific functions to record and perform related tasks are as follows:


Metadata

To set various metadata entries, use the CVideoRecorderUtility::AddMetaDataEntryL() function. The metadata entries are stored within the clip itself and can be retrieved or modified anytime during the recording.This is usually used to store information such as copyright information, creator, creation date and so on.

To retrieve specific metadata entries from a video clip, use the CVideoRecorderUtility::MetaDataEntryL() function.

The following code adds the copyright information to the video clip:

// Create Meta Entries
_LIT(name,"<Copyright>");
_LIT(data,"<Symbian ©) 2002>");
CMMFMetaDataEntry* metaData = NULL;
metaData = CMMFMetaDataEntry::NewL(name,data);
CleanupStack::PushL(metaData);
// Add the meta data entry
TRAP(err, iVideoRecorderUtility->AddMetaDataEntryL(*metaData));


Plug-in control

Custom commands

Custom commands are used to pass the message directly to the controller plug-in instead of going through APIs such as Play(), Record(), and so on.

To send a synchronous custom command to the controller, use the CustomCommandSync() function.

To send a asynchronous custom command to the controller, use the CustomCommandAsync() function.